<?php
namespace app\admin\controller;
use app\admin\controller\Base;
use app\common\model\SystemSet as SystemSetModel;
use app\common\model\SscRizhijl;
class Seelogin extends Base
{
    protected $sysmet=[];
    protected $sscrizhijl=[];
    public function _initialize()
    {
        parent::_initialize();
        $this->sysmet = new SystemSetModel();
        $this->sscrizhijl = new SscRizhijl();

    }
    /**
    **查询登录、同IP查询
     **/
    public function Jc_all()
    {
        
        $users=input('get.us_sql');
        if(input('get.cid')=='47'){
            $fileds="rz_ip";
            $where="";
            $order='';
            $limit="1";
            $result=$this->sscrizhijl->Rizhi($where,$order,$limit);
            $fileds="id,rz_class,rz_test,rz_time,rz_ip,rz_user";
            $where['rz_ip']=$result[0]['rz_ip'];
            $order='id desc';
            $limit="5";
            $nookczlist=$this->sscrizhijl->Rizhi($where,$order,$limit);
        }else{
            $fileds="id,rz_class,rz_test,rz_time,rz_ip,rz_user";
            $where['rz_class']=$users;
            $order='id desc';
            $limit="5";
            $nookczlist=$this->sscrizhijl->Rizhi($where,$order,$limit);
        }

        $this->assign('listes',$nookczlist);
        return $this->fetch("member/jc_all");
    }
    public function Search(){
        $us_sql=input('get.us_sql');
        $ip_sql=input('get.ip_sql');
        if($us_sql || $ip_sql){
            $fileds="id,rz_class,rz_test,rz_time,rz_ip,rz_user";
            $where = array(
                'rz_user'=>array(
                    'like',
                    "%$us_sql%"
                ),
                'rz_ip'=>array(
                    'like',
                    "%$ip_sql%"
                ),
            );
            $order='id desc';
            $limit="5";
            $nookczlist=$this->sscrizhijl->Rizhi($fileds,$where,$order,$limit);
            $this->assign('listes',$nookczlist);
        }
        return $this->fetch("member/jc_all");
    }



}